﻿using UnityEngine.SceneManagement;

public static partial class Extensions
{    
    /// <summary>
    /// 获取当前场景的对应id，解析失败则返回-1
    /// </summary>
    public static int GetId(this Scene scene)
    {
        var id = -1;
        if (scene.name.Contains("Scene_"))
        {
            id = int.Parse(scene.name.Remove("Scene_"));
        }
        return id;
    }
}
